Vote count: 0
I receive a JSON string retued from a remote Webservice. Something like this:
[{ "id": "001", "link": "<a href="https://www.google.com">Google</a>"
}, { "id": "002", "link": "<a href="https://www.yahoo.com">Yahoo!</a>"
}]
But then when i try to parse it in my Javascript, i have problem parsing it. I tried:
var response_string = '[{"id":"001","link":"<a href="https://www.google.com">Google</a>"},{"id":"002","link":"<a href="https://www.yahoo.com">Yahoo!</a>"}]';
console.log("Output (1) --> ", response_string);
var response_object = JSON.parse(response_string);
console.log("Output (2) --> ", response_object);
Then the outputs are like:
Output (1) --> [{"id":"001","link":"<a href="https://www.google.com">Google</a>"},{"id":"002","link":"<a href="https://www.yahoo.com">Yahoo!</a>"}]
Uncaught SyntaxError: Unexpected token h in JSON at position 30
I guess back soft...
ما را در سایت back soft دنبال می کنید
برچسب : javascript escape the room game,javascript escape the backslash,javascript escape the escape character, نویسنده : استخدام کار backsoft بازدید : 294 تاريخ : دوشنبه 29 شهريور 1395 ساعت: 5:32